<template>
    <div class="text-blue text-color-red">
        i18n => {{$t("common.ok")}}--{{$t("test2_I18n.test21")}}<br>
        serverApi => {{JSON.stringify(myData)}}<br>
        vuex => {{getCount}}
    </div>
</template>

<script>
import '../style/style.less'
import { testApi } from '../scripts/api'
import { mapMutations, mapGetters } from 'vuex'

export default {
  data () {
    return {
      myData: {}
    }
  },
  computed: {
    ...mapGetters('myModule', [
      'getCount'
    ])
  },
  methods: {
    ...mapMutations('myModule', [
      'increment'
    ])
  },
  mounted () {
    testApi().then((resp) => {
      this.myData = resp.data
    })
    this.increment() // this.$store.commit('myModule/increment')
    console.log('===$store====', this.$store.state.myModule.count)
  }
}
</script>

<style lang="less" type="text/less">
    .text-color-red {
        color: red;
    }
</style>
